<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="timer" style="color:red"></div> 
	</body>
	<SCRIPT LANGUAGE="JavaScript">
	var maxtime = 5*60
	function CountDown(){ 
	if(maxtime>=0){ 
	minutes = Math.floor(maxtime/60); //分钟
	seconds = Math.floor(maxtime%60); //秒钟
	msg = "距离结束还有"+minutes+"分"+seconds+"秒"; 
	document.all["timer"].innerHTML=msg; 
	if(maxtime == 5*60) alert('注意，还有5分钟!'); 
	--maxtime; 
	} 
	else{ 
	clearInterval(timer); 
	alert("时间到，结束!"); 
	} 
	} 
	timer = setInterval("CountDown()",1000); 
	</SCRIPT> 
</html>
